import sys

def main():
    if len(sys.argv) < 2:
        wer = open("wer.txt","r")
    else:
        wer = open(sys.argv[1],"r")
    
    last = "R"
    err = []
    alg = []


    for lines in wer:
        if lines[0] == "=":
            if lines[2] == ">":
                if last == "R":
                    #print lines.split()[1],
                    alg.append(lines.split()[1])
                else:
                    #print "999.9"
                    err.append(float("99.9"))
                    #print lines.split()[1],
                    alg.append(lines.split()[1])
            last = lines[0]
                
        if lines[0] == "R":
            if lines[5] == "m":
                err.append(float(lines.split()[4]))
                #print lines.split()[4]
                last = lines[0]
    
    
    for x in reversed(sorted(zip(err, alg))):
        print "%4.3f  %s" % x
    
if __name__ == '__main__':
    main()
